{extend name="common/base" }

{block name="style"}
<style>
    .cover {
        width: 60px;
        height: 40px;
        margin: auto;
        background-size: cover;
    }
</style>
{/block}

{block name="content"}
<form action="{:module_url('index')}" class="search-form">
	<div class="am-g">
		<div class="am-u-sm-12 am-u-md-3">
			<div class="am-btn-toolbar">
				<div class="am-btn-group am-btn-group-xs">
					<a class="am-btn am-btn-default" href="{:module_url('add')}">
						<span class="am-icon-plus"></span> 新增
					</a>
					<a class="am-btn am-btn-default nd-refresh">
						<span class="am-icon-refresh"></span> 刷新
					</a>
				</div>
			</div>
		</div>

		{$widget->search('select', ['name' => 'status', 'value' => $status, 'list' => $videoStatus])}

        {$widget->search('select', ['name' => 'video_type', 'value' => $video_type, 'list' => $videoType])}
        
        {$widget->search('select', ['name' => 'play_type', 'value' => $play_type, 'list' => $playType])}

		{$widget->search('keyword', ['name' => 'keyword', 'holder' => '关键词', 'value' => $keyword, 'md_num' => 3])}
	</div>
</form>

<div class="am-g">
    <div class="am-u-sm-12">

        <table class="am-table am-table-striped am-table-radius am-table-bordered">
            <thead>
                <tr>
                    <th>排序</th>
                    <th>视频名称</th>
                    <th>视频封面</th>
                    <th>视频类型</th>
                    <th>视频分类</th>
                    <th>总章节数</th>
                    <th>播放次数</th>
                    <th>播放方式</th>
                    <th>状态</th>
                    <th>时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {volist name="_list" id="vo"}
                <tr>
                    <td class="am-text-middle">
                        {$widget->row('text', ['style' => 'width:60px;' ,'value' => $vo['sort'], 'url' => module_url('modify', ['id' => $vo['id'],
                        'field' => 'sort'])])}
                    </td>
                    <td class="am-text-middle">{$vo.video_name}</td>
                    <td class="am-text-center am-text-middle">
                        <div class="cover" style="background-image: url('{$vo.cover}');"></div>
                    </td>
                    <td class="am-text-middle">
                        {$widget->row('select', ['value' => $vo['video_type'], 'list' => $videoType, 'url' => module_url('modify', ['id' => $vo['id'],
                        'field' => 'video_type'])])}
                    </td>
                    <td class="am-text-middle">
                        {$widget->row('select', ['value' => $vo['cate_id'], 'list' => $videoCate, 'url' => module_url('modify', ['id' => $vo['id'],
                        'field' => 'cate_id'])])}
                    </td>
                    <td class="am-text-middle">
                        {$widget->row('text', ['style' => 'width:60px;' ,'value' => $vo['count_chapter'], 'url' => module_url('modify', ['id' => $vo['id'],
                        'field' => 'count_chapter'])])}
                    </td>
                    <td class="am-text-middle">{$vo.count_play}</td>
                    <td class="am-text-middle">
                        {$widget->row('select', ['value' => $vo['play_type'], 'list' => $playType, 'url' => module_url('modify', ['id' => $vo['id'],
                        'field' => 'play_type'])])}
                    </td>
                    <td class="am-text-middle">
                        {$widget->row('select', ['value' => $vo['status'], 'list' => $videoStatus, 'url' => module_url('modify', ['id' => $vo['id'],
                        'field' => 'status'])])}
                    </td>
                    <td class="am-text-middle">{$vo.update_time}</td>
                    <td class="am-text-middle">
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                {$widget->row('button', ['title' => '添加', 'class' => 'am-text-primary', 'icon' => 'am-icon-plus', 'url' => module_url('video_source/add',
                                ['id' => $vo['id']])])}
                                {$widget->row('button', ['title' => '查看', 'class' => 'am-text-primary', 'icon' => 'am-icon-eye', 'url' => module_url('video_source/index', ['id' => $vo['id']])])}
                                {$widget->row('button', ['title' => '编辑', 'class' => 'am-text-secondary', 'icon' => 'am-icon-pencil-square-o', 'url' => module_url('edit',
                                ['id' => $vo['id']])])} {$widget->row('button', ['title' => '删除', 'class' => 'am-text-danger
                                ajax-get ajax-confirm', 'icon' => 'am-icon-trash-o', 'url' => module_url('delete', ['id'
                                => $vo['id']])])}
                            </div>
                        </div>
                    </td>
                </tr>
                {/volist}
            </tbody>
        </table>

        {if condition="!empty($_page)"}
        <div class="am-fl">共 {$_total} 条记录</div>
        <div class="am-fr">{$_page}</div>
        {/if}
    </div>
</div>
{/block}


{block name="script"}
	
{/block}